/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: yang
 * Date: 2022-09-20
 * Time: 14:50
 */
public class SingletonLazy {
    private static volatile SingletonLazy instance = null;
    private SingletonLazy(){

    }

    public static SingletonLazy getInstance(){
        if(instance == null){
            synchronized (SingletonLazy.class){
                if(instance == null){
                    instance = new SingletonLazy();
                }
            }
        }

        return instance;
    }

    public static void main(String[] args) {
        SingletonLazy.getInstance();
    }
}
